home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-07-25 | 865 b | 25 lines | [TEXT/PJMM] |
- { © 1993 Marek Hajek. Hajek 's Solutions. Created 6-12-93 }
- {--This example illustrates Integral Computations }
-
- {--------------------------Main Program----------------------------}
- PROGRAM Simpson;
- USES
- (* Make sure you include the sane library *)
- Auxiliary, Sane;
-
- CONST
- kLowerLimit = -1; (* Corresponds to "a" *)
- kUpperLimit = 1; (* Corresponds to "b" *)
- kPartitions = 4; (* Corresponds to n = 100 *)
-
- VAR
- result: Extended; (* The approximated result of the Integral *)
-
- BEGIN
- ShowText;
-
- result := ComputeIntegral(kLowerLimit, kUpperLimit, kPartitions, IntegrandFunction);
- writeln('Integral with lower/upper limits ', kLowerLimit : 0, '/', kUpperLimit : 0, ', subintervals ', kPartitions : 0, ' is: ', result);
-
- readln; (* Stop here before the text window disappears *)
- END.